package edu.pitt.coe1186.theta.util;

import java.util.ArrayList;

/**
 *
 * @author Yuxin Liu
 */
public class Global {
	private static Global instance;
	private static boolean isNew;
    
    public static synchronized Global getInstance() {
		if (instance == null)
			instance = new Global();
		return instance;
	}

	public boolean isNew() {
		return isNew;
	}

	/********************************
		Start From Here!!!
		
		Instructions: 
		1. Declare variable.
		2. Write setter and getter

		Sample usage:
		in your class, 
		import package edu.pitt.coe1186.theta.util.Global;

		Global g = Global.getInstance();
		
		//global Varable
		if(g.getMyArray()==null){
			g.setMyArray(new Array<int>[200]);
		}
		g.getMyArray()[0] = 1;



		//if your varible is a class
		if(g.getX()==null){
			g.setX(new ClassX());
		}
		g.getX().yourClassFunctionCall() = 2;
	*********************************/

	/********************************
		Declare Class Here
	*********************************/
	public static class Name {
		private String _first, _last;

		public String getFirst() {
			return _first;
		}

		public String getLast() {
			return _last;
		}

		public void setFirst(String s) {
			_first = s;
		}

		public void setLast(String s) {
			_last = s;
		}
	}
        
        public static class TrainCoords{
                private double x;
                private double y;
                private int trainID;

                public double getX(){
                        return x;
                }

                public double getY(){
                        return y;
                }
                public double getID(){
                        return trainID;
                }
                public void setX(double xVal){
                        x = xVal;
                }
                public void setY(double yVal){
                        y = yVal;
                }
        }



	/********************************
		Declare variables Here
	*********************************/
	private static int[] Signals;
	private static Name name;
        private static ArrayList<TrainCoords> Trains;
	



	/********************************
	  Write setter and getter Here
	*********************************/
	public void setSignals(int[] s){
		Signals = s;
	}
	public int[] getSignals(){
		return Signals;
	}

	public void setName(Name n) {
		name = n;
	}
	public Name getName() {
		return name;
	}
        public void setTrains(ArrayList<TrainCoords> list){
                Trains = list;
        }
        public ArrayList<TrainCoords> getTrains(){
                return Trains;
        }




}
